# -*- coding: utf-8 -*-
# Author: xiantingDeng
# File: 09_通用装饰器.py
# Time: 21:43
"""

def func(functionName):
    def func_in(*args, **kwargs):
        print("-----记录日志-----")
        ret = functionName(*args, **kwargs)
        return ret

    return func_in

@func
def dtest():
    print("----test----")
    return "haha"

@func
def dtest2():
    print("----test2---")

@func
def dtest3(a):
    print("-----test3--a=%d--"%a)

ret = dtest()
print("test return value is %s"%ret)

a = dtest2()
print("test2 return value is %s"%a)


dtest3(11)
"""


def func_closure(message):
    def get_message(func):
        print("测试一下")

        def demo(*args,**kwargs):
            print("正在执行func")
            return func(*args,**kwargs)

        return demo

    return get_message

@func_closure(message="测试")
def dooer(message):
    print("正在进行测试啦：{}".format(message))

if __name__ == '__main__':
    dooer("你在想屁吃")